/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client.domainModels.NodeImpl;

import java.util.ArrayList;



import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

//import GUI.view.MultiLineTable;

import client.domainModels.Node.Node;

/**
 * 
 * @author Wei WANG
 */
public class Case extends AbstractNode {

	@Override
	public String[] getChildNodeNames() {
		String[] strings = { "Event" };
		return strings;
	}

	@Override
	public String[] getNodeAttributes() {
		// TODO Auto-generated method stub
		String[] attributes = { "name" };
		return attributes;
	}

	public String toString() {
		return "Case: " + getID();
	}

	@Override
	public String getStringRepresentation() {
		// TODO Auto-generated method stub
		String ret ="<case name='" +this.getID()+"'>\n";
		ret+=this.childReader("Event");
		ret+="</case>\n";
		return ret;
	}
	private String childReader(String type){
		String ret="";
		ArrayList<Node> aux = this.getChildNodes(type);
		if (aux != null){
			for(int i = 0;i<aux.size();i++){
				ret+=aux.get(i).getStringRepresentation();
			}
		}
		return ret;
	}
}
